﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:cal="clr-namespace:Microsoft.Practices.Composite.Presentation.Regions;assembly=Microsoft.Practices.Composite.Presentation"
                    xmlns:CommandExtensions="clr-namespace:Core.Infrastructure.CommandExtensions;assembly=Core.Infrastructure"
                    xmlns:my="clr-namespace:Core.Infrastructure.Controls;assembly=Core.Infrastructure"
                    xmlns:my2="clr-namespace:Core.ScreenStore.View;assembly=Core.ScreenStore"
                    xmlns:controls="clr-namespace:Core.Infrastructure.Controls;assembly=Core.Infrastructure"
                    xmlns:core="clr-namespace:Core;assembly=Core"
                    xmlns:System="clr-namespace:System;assembly=mscorlib">

    <!-- Core styles start-->
    <Color x:Key="main-bg-color">#ffF3F7FA</Color>
    <Color x:Key="menu-bg-color">#ffD3D9CB</Color>
    <Color x:Key="title-color">#ff08BBD1</Color>
    <Color x:Key="menu-item-color">#ff080000</Color>

    <SolidColorBrush  Color="{StaticResource main-bg-color}"
                      x:Key="main-background" />
    <SolidColorBrush x:Key="menu-background"
                     Color="{StaticResource menu-bg-color}" />

    <Style x:Key="menu-item"
           TargetType="TextBlock">
        <Setter Property="Foreground">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1"
                                     StartPoint="0.5,0">
                    <GradientStop Color="{StaticResource menu-item-color}"
                                  Offset="0.1" />
                    <GradientStop Color="{StaticResource menu-item-color}"
                                  Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="FontSize"
                Value="20" />
        <Setter Property="FontFamily"
                Value="Segoe UI Light" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="TextOptions.TextHintingMode"
                Value="Animated" />
    </Style>

    <Style TargetType="HyperlinkButton"
           x:Key="linkArticleStyle">
        <Setter Property="FontSize"
                Value="14" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="Margin"
                Value="20" />
        <Setter Property="MaxWidth"
                Value="800" />
    </Style>
    
    <Style TargetType="TextBlock"
           x:Key="textArticleStyle">
        <Setter Property="FontSize"
                Value="14" />
        <Setter Property="HorizontalAlignment"
                Value="Left" />
        <Setter Property="TextWrapping"
                Value="Wrap" />
        <Setter Property="Margin"
                Value="20" />
        <Setter Property="MaxWidth"
                Value="800" />
    </Style>

    <Style x:Key="main-title-style"
           TargetType="TextBlock">
        <Setter Property="Foreground">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1"
                                     StartPoint="0.5,0">
                    <GradientStop Color="{StaticResource title-color}"
                                  Offset="0.1" />
                    <GradientStop Color="{StaticResource title-color}"
                                  Offset="1" />
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="FontSize"
                Value="30" />
        <Setter Property="FontFamily"
                Value="Segoe UI Light" />
        <Setter Property="VerticalAlignment"
                Value="Center" />
        <Setter Property="TextOptions.TextHintingMode"
                Value="Animated" />
    </Style>

    <SolidColorBrush x:Key="NavigationBackgroundColorBrush"
                     Color="#FF484848" />
    <SolidColorBrush x:Key="NavigationForegroundColorBrush"
                     Color="#FFFFFFFF" />
    <SolidColorBrush x:Key="HighLightColorBrush"
                     Color="#FF0097FC" />
    <SolidColorBrush x:Key="HoverHyperlinkForegroundColorBrush"
                     Color="Black" />
    <SolidColorBrush x:Key="HoverHyperLinkBackgroundColorBrush"
                     Color="White" />
    <SolidColorBrush x:Key="BodyTextColorBrush"
                     Color="#FF313131" />
    <SolidColorBrush x:Key="AliceBlueColorBrush"
                     Color="AliceBlue" />
    <Color x:Key="Gray1">#FFCCCCCC</Color>
    <Color x:Key="HighlightDarkColor">#FF119EDA</Color>
    <Color x:Key="HighlightLightColor">#FFB2E0F4</Color>

    <Color x:Key="Gray2">#FF7F7F7F</Color>
    <Color x:Key="Gray3">#FF333333</Color>

    <Color x:Key="Gray4">#FFB9B9B9</Color>

    <Color x:Key="Gray5">#FFD8D8D9</Color>

    <Color x:Key="Gray6">#FF9D9D9D</Color>

    <Color x:Key="Gray7">#FFF7F7F7</Color>
    <Color x:Key="Gray8">#FFE0E0E0</Color>

    <Color x:Key="Gray9">#FFA59F93</Color>

    <SolidColorBrush x:Key="TextBoxBorderBrush"
                     Color="{StaticResource Gray1}" />

    <Style TargetType="Button"
           x:Key="button-style">
        <Setter Property="Background">
            <Setter.Value>
                <SolidColorBrush Color="{StaticResource Gray7}" />
            </Setter.Value>
        </Setter>
        <Setter Property="Foreground"
                Value="{StaticResource HighLightColorBrush}" />
        <Setter Property="Padding"
                Value="5,6" />
        <Setter Property="BorderThickness"
                Value="1" />
        <Setter Property="BorderBrush"
                Value="{StaticResource TextBoxBorderBrush}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="Button">
                    <Grid>
                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="MouseOverBorder">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="PressedBorder">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Disabled">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="Opacity"
                                                                       Storyboard.TargetName="DisabledVisualElement">
                                            <SplineDoubleKeyFrame KeyTime="0"
                                                                  Value="0.7" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="contentPresenter">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="0.3" />
                                        </DoubleAnimationUsingKeyFrames>
                                    </Storyboard>
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="FocusStates">
                                <VisualState x:Name="Focused">
                                    <Storyboard>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="FocusRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>
                                        <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
                                                                       Storyboard.TargetName="FocusInnerRectangle">
                                            <EasingDoubleKeyFrame KeyTime="0"
                                                                  Value="1" />
                                        </DoubleAnimationUsingKeyFrames>

                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Unfocused" />
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                        <Border x:Name="Background"
                                BorderBrush="{TemplateBinding BorderBrush}"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                Background="{TemplateBinding Background}"
                                CornerRadius="3" />
                        <Rectangle x:Name="DisabledVisualElement"
                                   Fill="#FFFFFFFF"
                                   IsHitTestVisible="false"
                                   Opacity="0"
                                   RadiusY="3"
                                   RadiusX="3" />
                        <Border x:Name="MouseOverBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0">
                            <Border.Background>
                                <SolidColorBrush Color="{StaticResource Gray8}" />
                            </Border.Background>
                        </Border>
                        <Border x:Name="PressedBorder"
                                BorderThickness="{TemplateBinding BorderThickness}"
                                CornerRadius="3.5"
                                Opacity="0">
                            <Border.Background>
                                <SolidColorBrush Color="{StaticResource Gray5}" />
                            </Border.Background>
                        </Border>
                        <Rectangle x:Name="FocusRectangle"
                                   RadiusY="4"
                                   RadiusX="4"
                                   Margin="-1"
                                   Opacity="0" />
                        <Rectangle x:Name="FocusInnerRectangle"
                                   StrokeThickness="{TemplateBinding BorderThickness}"
                                   RadiusX="3"
                                   RadiusY="3"
                                   Opacity="0" />
                        <ContentPresenter x:Name="contentPresenter"
                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                          Content="{TemplateBinding Content}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          Margin="{TemplateBinding Padding}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="FontWeight"
                Value="Bold" />
    </Style>


    <Style TargetType="my:ContentControlWithVisualStates"
           x:Key="MainRegionStyle">

        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="my:ContentControlWithVisualStates">
                    <Grid x:Name="ContentPresenter">
                        <Grid.Resources>
                            <Storyboard x:Name="EnterAnimation">
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                               Storyboard.TargetProperty="(UIElement.Opacity)"
                                                               Storyboard.TargetName="ContentPresenter">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                          Value="0" />
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.500"
                                                          Value="1" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                            <Storyboard x:Name="LeaveAnimation">
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                               Storyboard.TargetProperty="(UIElement.Opacity)"
                                                               Storyboard.TargetName="ContentPresenter">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                          Value="1" />
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.500"
                                                          Value="0" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </Grid.Resources>

                        <Grid.RenderTransform>
                            <TranslateTransform />
                        </Grid.RenderTransform>

                        <ContentPresenter Content="{TemplateBinding Content}"
                                          ContentTemplate="{TemplateBinding ContentTemplate}"
                                          Cursor="{TemplateBinding Cursor}"
                                          Margin="{TemplateBinding Padding}"
                                          HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                          VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />

                    </Grid>

                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ShellViewStyle"
           TargetType="core:ShellView">
        <Setter Property="CommandExtensions:ControlLoaded.Command"
                Value="{Binding Loaded}" />
        <Setter Property="CommandExtensions:ControlUnloaded.Command"
                Value="{Binding Unloaded}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="core:ShellView">
                    <Grid x:Name="LayoutRoot"
                          HorizontalAlignment="Stretch"
                          Background="{StaticResource main-background}"
                          VerticalAlignment="Stretch">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="70" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition />
                        </Grid.ColumnDefinitions>
                        <StackPanel HorizontalAlignment="Stretch"
                                    Orientation="Horizontal"
                                    Height="Auto"
                                    Grid.Row="0"
                                    Grid.Column="0"
                                    x:Name="MenuContainer"
                                    Background="{StaticResource menu-background}">
                            <TextBlock Text="Application Title"
                                       Style="{StaticResource main-title-style}"
                                       Margin="20 20 20 20" />
                            <ItemsControl x:Name="MenuPanel"
                                          Grid.Row="0"
                                          ItemsSource="{Binding Path=MenuData.MenuItems}"
                                          Width="Auto"
                                          Height="40"
                                          HorizontalAlignment="Right">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <StackPanel Orientation="Horizontal" />
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <Button Style="{StaticResource button-style}"
                                                    Content="{Binding Path=Description}"
                                                    Command="{Binding Mode=OneWay, Path=DataContext.MenuClickCommand, ElementName=LayoutRoot}"
                                                    CommandParameter="{Binding Path=This}" />
                                        </StackPanel>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                            <ItemsControl Grid.Row="0"
                                          ItemsSource="{Binding Path=Tags}"
                                          Width="Auto"
                                          Height="40"
                                          HorizontalAlignment="Right">
                                <ItemsControl.ItemsPanel>
                                    <ItemsPanelTemplate>
                                        <StackPanel Orientation="Horizontal" />
                                    </ItemsPanelTemplate>
                                </ItemsControl.ItemsPanel>
                                <ItemsControl.ItemTemplate>
                                    <DataTemplate>
                                        <StackPanel Orientation="Horizontal">
                                            <Button Style="{StaticResource button-style}"
                                                    Content="{Binding Path=Name}"
                                                    Command="{Binding Mode=OneWay, Path=DataContext.ShowArticlesByTagCommand, ElementName=LayoutRoot}"
                                                    CommandParameter="{Binding}" />
                                        </StackPanel>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                            <Button Command="{Binding ToogleFullScreen}"
                                    Style="{StaticResource button-style}"
                                    Content="set full screen"
                                    Width="Auto"
                                    Height="40"
                                    HorizontalAlignment="Right" />
                        </StackPanel>
                        <my:ContentControlWithVisualStates x:Name="MainRegion"
                                                           DataContext="{Binding AnimationService}"
                                                           Style="{StaticResource MainRegionStyle}"
                                                           LeaveAnimation="{Binding LeaveViewVisibilityStoryboard, Mode=TwoWay}"
                                                           EnterAnimation="{Binding EnterViewVisibilityStoryboard, Mode=TwoWay}"
                                                           Grid.Row="1"
                                                           HorizontalAlignment="Stretch"
                                                           HorizontalContentAlignment="Stretch"
                                                           VerticalContentAlignment="Stretch"
                                                           Background="Transparent"
                                                           VerticalAlignment="Stretch" />
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>


    <Style TargetType="controls:BusyAnimation"
           x:Key="BusyAnimationStyle">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="controls:BusyAnimation">
                    <Grid x:Name="LayoutRoot"
                          Background="Transparent">
                        <Grid.Resources>
                            <Storyboard x:Name="Animation"
                                        RepeatBehavior="Forever">
                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="n0"
                                                               BeginTime="0:0:0.0"
                                                               Storyboard.TargetProperty="Opacity">
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.1"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.2"
                                                            Value="0.7" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.3"
                                                            Value="1" />
                                </DoubleAnimationUsingKeyFrames>

                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="n1"
                                                               BeginTime="0:0:0.1"
                                                               Storyboard.TargetProperty="Opacity">
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.1"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.2"
                                                            Value="0.7" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.3"
                                                            Value="1" />
                                </DoubleAnimationUsingKeyFrames>


                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="n2"
                                                               BeginTime="0:0:0.2"
                                                               Storyboard.TargetProperty="Opacity">
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.1"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.2"
                                                            Value="0.7" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.3"
                                                            Value="1" />
                                </DoubleAnimationUsingKeyFrames>

                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="n3"
                                                               BeginTime="0:0:0.3"
                                                               Storyboard.TargetProperty="Opacity">
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.1"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.2"
                                                            Value="0.7" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.3"
                                                            Value="1" />
                                </DoubleAnimationUsingKeyFrames>

                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="n4"
                                                               BeginTime="0:0:0.4"
                                                               Storyboard.TargetProperty="Opacity">
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.1"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.2"
                                                            Value="0.7" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.3"
                                                            Value="1" />
                                </DoubleAnimationUsingKeyFrames>

                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="n5"
                                                               BeginTime="0:0:0.0"
                                                               Storyboard.TargetProperty="Opacity">
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                            Value="1" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.5"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.6"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.7"
                                                            Value="0.7" />

                                </DoubleAnimationUsingKeyFrames>

                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="n6"
                                                               BeginTime="0:0:0.0"
                                                               Storyboard.TargetProperty="Opacity">
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                            Value="0.7" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.1"
                                                            Value="1" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.6"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.7"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.8"
                                                            Value="0.7" />
                                </DoubleAnimationUsingKeyFrames>


                                <DoubleAnimationUsingKeyFrames Storyboard.TargetName="n7"
                                                               BeginTime="0:0:0.0"
                                                               Storyboard.TargetProperty="Opacity">
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.0"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.1"
                                                            Value="0.7" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.2"
                                                            Value="1" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.7"
                                                            Value="0.5" />
                                    <DiscreteDoubleKeyFrame KeyTime="0:0:0.8"
                                                            Value="0.5" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </Grid.Resources>
                        <StackPanel x:Name="statusPanel"
                                    Width="50"
                                    Height="50"
                                    Grid.Row="1"
                                    Orientation="Vertical">
                            <Grid x:Name="AnimationGrid"
                                  HorizontalAlignment="Center">
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="10" />
                                    <RowDefinition Height="10" />
                                    <RowDefinition Height="10" />
                                    <RowDefinition Height="10" />
                                    <RowDefinition Height="10" />
                                </Grid.RowDefinitions>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="10" />
                                    <ColumnDefinition Width="10" />
                                    <ColumnDefinition Width="10" />
                                    <ColumnDefinition Width="10" />
                                    <ColumnDefinition Width="10" />
                                </Grid.ColumnDefinitions>
                                <TextBlock Grid.ColumnSpan="3"
                                           Grid.Row="2"
                                           Grid.Column="1"
                                           Text=""
                                           FontSize="4"
                                           TextAlignment="Center"
                                           Margin="2"
                                           Foreground="LightBlue" />
                                <StackPanel Grid.RowSpan="2"
                                            Grid.Row="0"
                                            Grid.ColumnSpan="2"
                                            Grid.Column="0">
                                    <Ellipse  x:Name="n7"
                                              Width="10"
                                              Height="10"
                                              Margin="6 6 4 4"
                                              Fill="{TemplateBinding Foreground}"> 
                                    </Ellipse>
                                </StackPanel>
                                <StackPanel Grid.RowSpan="2"
                                            Grid.Row="3"
                                            Grid.ColumnSpan="2"
                                            Grid.Column="3">
                                    <Ellipse  x:Name="n3"
                                              Width="10"
                                              Height="10"
                                              Margin="4 4 6 6"
                                              Fill="{TemplateBinding Foreground}">
                                    </Ellipse>
                                </StackPanel>
                                <StackPanel Grid.RowSpan="2"
                                            Grid.Row="0"
                                            Grid.ColumnSpan="2"
                                            Grid.Column="3">
                                    <Ellipse x:Name="n1"
                                             Width="10"
                                             Height="10"
                                             Margin="4 6 6 4"
                                             Fill="{TemplateBinding Foreground}">
                                    </Ellipse>
                                </StackPanel>

                                <StackPanel Grid.RowSpan="2"
                                            Grid.Row="3"
                                            Grid.ColumnSpan="2"
                                            Grid.Column="0">
                                    <Ellipse x:Name="n5"
                                             Width="10"
                                             Height="10"
                                             Margin="6 4 4 6"
                                             Fill="{TemplateBinding Foreground}">
                                    </Ellipse>
                                </StackPanel>
                                <Ellipse  Grid.Row="0"
                                          x:Name="n0"
                                          Grid.Column="2"
                                          Fill="{TemplateBinding Foreground}">
                                </Ellipse>
                                <Ellipse   Grid.Row="2"
                                           x:Name="n6"
                                           Grid.Column="0"
                                           Fill="{TemplateBinding Foreground}">
                                </Ellipse>
                                <Ellipse  Grid.Row="4"
                                          x:Name="n4"
                                          Grid.Column="2"
                                          Fill="{TemplateBinding Foreground}">
                                </Ellipse>
                                <Ellipse  Grid.Row="2"
                                          x:Name="n2"
                                          Grid.Column="4"
                                          Fill="{TemplateBinding Foreground}">
                                </Ellipse>
                            </Grid>
                        </StackPanel>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
    
    <Style x:Key="ArticleDetailsViewStyle"
           TargetType="my2:ArticleDetailsView">
        <Setter Property="ContentProvider"
                Value="{Binding ContentProvider}" />
        <Setter Property="Article"
                Value="{Binding Article}" />
        <Setter Property="ResourceProvider"
                Value="{Binding ResourceProvider}" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="my2:ArticleDetailsView">
                    <Grid x:Name="LayoutRoot">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="60"></RowDefinition>
                            <RowDefinition></RowDefinition>
                            <RowDefinition Height="40"></RowDefinition>
                        </Grid.RowDefinitions>
                        <Grid Height="50" Grid.Row="0">
                            <Border BorderBrush="LightBlue" BorderThickness="4" Width="700" Height="50"></Border>
                            <TextBlock x:Name="Title"
                                 Width="auto"
                                 Height="25"
                                 HorizontalAlignment="Center"
                                 VerticalAlignment="Center"
                                 DataContext="{Binding Article}"
                                 Text="{Binding Title}"
                                 FontStyle="Oblique"
                                 Foreground="Blue"
                                 FontFamily="Segoe UI Light"
                                 FontSize="20"
                                 Grid.Row="0" />
                        </Grid>
                        <ScrollViewer Grid.Row="1">
                            <StackPanel  x:Name="Content"                          
                                              Width="Auto"
                                              Height="Auto"
                                              Margin="1" />
                        </ScrollViewer>
                        <ListBox x:Name="Tags"
                                 DataContext="{Binding Article}"
                                 ItemsSource="{Binding Tags}"
                                 Grid.Row="2"
                                 Height="auto"
                                 Width="auto"
                                 Margin="1"
                                 Background="LightBlue">
                            <ListBox.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <StackPanel Orientation="Horizontal" />
                                </ItemsPanelTemplate>
                            </ListBox.ItemsPanel>
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Button Style="{StaticResource button-style}"
                                            Command="{Binding ElementName=LayoutRoot, Path=DataContext.SelectTagCommand}"
                                            CommandParameter="{Binding}"
                                            Content="{Binding Name}" />
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>

                        <!--<ListBox x:Name="ItemsList" ItemsSource="{Binding Article.Items}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel>
                                        <TextBlock x:Name="Type" Text="{Binding Type}"/>
                                        <TextBlock x:Name="Value" Text="{Binding Value}" />
                                        
                                    </StackPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>-->

                        <VisualStateManager.VisualStateGroups>
                            <VisualStateGroup x:Name="CommonStates">
                                <VisualState x:Name="Normal" />
                                <VisualState x:Name="MouseOver">
                                    <Storyboard>
                                        <DoubleAnimation Storyboard.TargetName="Content"
                                                         Storyboard.TargetProperty="Opacity"
                                                         From="1.0"
                                                         To="0.0"
                                                         Duration="0:0:1"
                                                         AutoReverse="True"
                                                          />
                                    </Storyboard>
                                </VisualState>
                                <VisualState x:Name="Pressed">
                                </VisualState>
                            </VisualStateGroup>
                            <VisualStateGroup x:Name="OtherStates">
                                <VisualState x:Name="Focused">
                                </VisualState>
                            </VisualStateGroup>
                        </VisualStateManager.VisualStateGroups>
                    </Grid>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ArticlesViewStyle"
           TargetType="my2:ArticlesView">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="my2:ArticlesView">
                    <StackPanel x:Name="LayoutPanel">
                        <controls:BusyAnimation Style="{StaticResource BusyAnimationStyle}"
                                                Visibility="{Binding IsBusy,Converter={StaticResource BoolToVisibilityConverter}}"
                                                Height="100"
                                                Width="100"
                                                Foreground="LightBlue" />
                        
                        <ListBox ItemsSource="{Binding Articles}"
                                 Visibility="{Binding IsBusy,Converter={StaticResource BoolNegatorToVisibilityConverter}}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <StackPanel>
                                        <Button Style="{StaticResource button-style}"
                                                Command="{Binding ElementName=LayoutPanel, Path=DataContext.SelectArticleCommand}"
                                                CommandParameter="{Binding}"
                                                Content="{Binding Title}"></Button>
                                        <TextBox Text="{Binding PublishDate}" />
                                    </StackPanel>
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style x:Key="ThemeSelectViewStyle"
           TargetType="my2:ThemeSelectView">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="my2:ThemeSelectView">
                    <StackPanel x:Name="LayoutPanel">
                        <TextBlock Text="Select a theme"
                                   Style="{StaticResource main-title-style}" />
                        <ListBox ItemsSource="{Binding Themes}">
                            <ListBox.ItemTemplate>
                                <DataTemplate>
                                    <Button Style="{StaticResource button-style}"
                                            Command="{Binding ElementName=LayoutPanel, Path=DataContext.SelectThemeCommand}"
                                            CommandParameter="{Binding}"
                                            Content="{Binding Name}" />
                                </DataTemplate>
                            </ListBox.ItemTemplate>
                        </ListBox>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
